﻿using System;
using System.Data;
using System.Text;
using System.Data.OracleClient;
using DBUtility;//Please add references
namespace TierApplication
{
	/// <summary>
	/// 类T_ALIPAYNOTIFYASYN。
	/// </summary>
	[Serializable]
	public partial class T_ALIPAYNOTIFYASYN
	{
		public T_ALIPAYNOTIFYASYN()
		{}
		#region Model
		private string _notifyasynid;
		private DateTime? _notify_time;
		private string _notify_type;
		private string _notify_id;
		private string _sign_type;
		private string _sign;
		private string _out_trade_no;
		private string _subject;
		private string _payment_type;
		private string _trade_no;
		private string _trade_status;
		private DateTime? _gmt_create;
		private DateTime? _gmt_payment;
		private DateTime? _gmt_close;
		private string _refund_status;
		private DateTime? _gmt_refund;
		private string _seller_email;
		private string _buyer_email;
		private string _seller_id;
		private string _buyer_id;
		private decimal? _price;
		private decimal? _total_fee;
		private decimal? _quantity;
		private string _body;
		private decimal? _discount;
		private string _is_total_fee_adjust;
		private string _use_coupon;
		private string _extra_common_param;
		/// <summary>
		/// 序列号
		/// </summary>
		public string NOTIFYASYNID
		{
			set{ _notifyasynid=value;}
			get{return _notifyasynid;}
		}
		/// <summary>
		/// 通知时间
		/// </summary>
		public DateTime? NOTIFY_TIME
		{
			set{ _notify_time=value;}
			get{return _notify_time;}
		}
		/// <summary>
		/// 通知类型
		/// </summary>
		public string NOTIFY_TYPE
		{
			set{ _notify_type=value;}
			get{return _notify_type;}
		}
		/// <summary>
		/// 通知校验ID
		/// </summary>
		public string NOTIFY_ID
		{
			set{ _notify_id=value;}
			get{return _notify_id;}
		}
		/// <summary>
		/// 签名方式 
		/// </summary>
		public string SIGN_TYPE
		{
			set{ _sign_type=value;}
			get{return _sign_type;}
		}
		/// <summary>
		/// 签名
		/// </summary>
		public string SIGN
		{
			set{ _sign=value;}
			get{return _sign;}
		}
		/// <summary>
		/// 商户网站唯一订单号
		/// </summary>
		public string OUT_TRADE_NO
		{
			set{ _out_trade_no=value;}
			get{return _out_trade_no;}
		}
		/// <summary>
		/// 商品名称
		/// </summary>
		public string SUBJECT
		{
			set{ _subject=value;}
			get{return _subject;}
		}
		/// <summary>
		/// 支付类型
		/// </summary>
		public string PAYMENT_TYPE
		{
			set{ _payment_type=value;}
			get{return _payment_type;}
		}
		/// <summary>
		/// 支付宝交易号
		/// </summary>
		public string TRADE_NO
		{
			set{ _trade_no=value;}
			get{return _trade_no;}
		}
		/// <summary>
		/// 交易状态
		/// </summary>
		public string TRADE_STATUS
		{
			set{ _trade_status=value;}
			get{return _trade_status;}
		}
		/// <summary>
		/// 交易创建时间
		/// </summary>
		public DateTime? GMT_CREATE
		{
			set{ _gmt_create=value;}
			get{return _gmt_create;}
		}
		/// <summary>
		/// 交易付款时间
		/// </summary>
		public DateTime? GMT_PAYMENT
		{
			set{ _gmt_payment=value;}
			get{return _gmt_payment;}
		}
		/// <summary>
		/// 交易关闭时间
		/// </summary>
		public DateTime? GMT_CLOSE
		{
			set{ _gmt_close=value;}
			get{return _gmt_close;}
		}
		/// <summary>
		/// 退款状态
		/// </summary>
		public string REFUND_STATUS
		{
			set{ _refund_status=value;}
			get{return _refund_status;}
		}
		/// <summary>
		/// 退款时间
		/// </summary>
		public DateTime? GMT_REFUND
		{
			set{ _gmt_refund=value;}
			get{return _gmt_refund;}
		}
		/// <summary>
		/// 卖家支付宝账号
		/// </summary>
		public string SELLER_EMAIL
		{
			set{ _seller_email=value;}
			get{return _seller_email;}
		}
		/// <summary>
		/// 买家支付宝账号
		/// </summary>
		public string BUYER_EMAIL
		{
			set{ _buyer_email=value;}
			get{return _buyer_email;}
		}
		/// <summary>
		/// 卖家支付宝账户号
		/// </summary>
		public string SELLER_ID
		{
			set{ _seller_id=value;}
			get{return _seller_id;}
		}
		/// <summary>
		/// 买家支付宝账户号
		/// </summary>
		public string BUYER_ID
		{
			set{ _buyer_id=value;}
			get{return _buyer_id;}
		}
		/// <summary>
		/// 商品单价
		/// </summary>
		public decimal? PRICE
		{
			set{ _price=value;}
			get{return _price;}
		}
		/// <summary>
		/// 交易金额
		/// </summary>
		public decimal? TOTAL_FEE
		{
			set{ _total_fee=value;}
			get{return _total_fee;}
		}
		/// <summary>
		/// 购买数量
		/// </summary>
		public decimal? QUANTITY
		{
			set{ _quantity=value;}
			get{return _quantity;}
		}
		/// <summary>
		/// 商品描述
		/// </summary>
		public string BODY
		{
			set{ _body=value;}
			get{return _body;}
		}
		/// <summary>
		/// 折扣
		/// </summary>
		public decimal? DISCOUNT
		{
			set{ _discount=value;}
			get{return _discount;}
		}
		/// <summary>
		/// 是否调整总价
		/// </summary>
		public string IS_TOTAL_FEE_ADJUST
		{
			set{ _is_total_fee_adjust=value;}
			get{return _is_total_fee_adjust;}
		}
		/// <summary>
		/// 是否使用红包买家
		/// </summary>
		public string USE_COUPON
		{
			set{ _use_coupon=value;}
			get{return _use_coupon;}
		}
		/// <summary>
		/// 公用回传参数
		/// </summary>
		public string EXTRA_COMMON_PARAM
		{
			set{ _extra_common_param=value;}
			get{return _extra_common_param;}
		}
		#endregion Model


		#region  Method

		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public T_ALIPAYNOTIFYASYN(string NOTIFYASYNID)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select NOTIFYASYNID,NOTIFY_TIME,NOTIFY_TYPE,NOTIFY_ID,SIGN_TYPE,SIGN,OUT_TRADE_NO,SUBJECT,PAYMENT_TYPE,TRADE_NO,TRADE_STATUS,GMT_CREATE,GMT_PAYMENT,GMT_CLOSE,REFUND_STATUS,GMT_REFUND,SELLER_EMAIL,BUYER_EMAIL,SELLER_ID,BUYER_ID,PRICE,TOTAL_FEE,QUANTITY,BODY,DISCOUNT,IS_TOTAL_FEE_ADJUST,USE_COUPON,EXTRA_COMMON_PARAM ");
			strSql.Append(" FROM T_ALIPAYNOTIFYASYN ");
			strSql.Append(" where NOTIFYASYNID=:NOTIFYASYNID ");
			OracleParameter[] parameters = {
					new OracleParameter(":NOTIFYASYNID", OracleType.VarChar,50)};
			parameters[0].Value = NOTIFYASYNID;

			DataSet ds=DbHelperOra.Query(strSql.ToString(),parameters);
			if(ds.Tables[0].Rows.Count>0)
			{
				if(ds.Tables[0].Rows[0]["NOTIFYASYNID"]!=null && ds.Tables[0].Rows[0]["NOTIFYASYNID"].ToString()!="")
				{
					this.NOTIFYASYNID=ds.Tables[0].Rows[0]["NOTIFYASYNID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["NOTIFY_TIME"]!=null && ds.Tables[0].Rows[0]["NOTIFY_TIME"].ToString()!="")
				{
					this.NOTIFY_TIME=DateTime.Parse(ds.Tables[0].Rows[0]["NOTIFY_TIME"].ToString());
				}
				if(ds.Tables[0].Rows[0]["NOTIFY_TYPE"]!=null && ds.Tables[0].Rows[0]["NOTIFY_TYPE"].ToString()!="")
				{
					this.NOTIFY_TYPE=ds.Tables[0].Rows[0]["NOTIFY_TYPE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["NOTIFY_ID"]!=null && ds.Tables[0].Rows[0]["NOTIFY_ID"].ToString()!="")
				{
					this.NOTIFY_ID=ds.Tables[0].Rows[0]["NOTIFY_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["SIGN_TYPE"]!=null && ds.Tables[0].Rows[0]["SIGN_TYPE"].ToString()!="")
				{
					this.SIGN_TYPE=ds.Tables[0].Rows[0]["SIGN_TYPE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["SIGN"]!=null && ds.Tables[0].Rows[0]["SIGN"].ToString()!="")
				{
					this.SIGN=ds.Tables[0].Rows[0]["SIGN"].ToString();
				}
				if(ds.Tables[0].Rows[0]["OUT_TRADE_NO"]!=null && ds.Tables[0].Rows[0]["OUT_TRADE_NO"].ToString()!="")
				{
					this.OUT_TRADE_NO=ds.Tables[0].Rows[0]["OUT_TRADE_NO"].ToString();
				}
				if(ds.Tables[0].Rows[0]["SUBJECT"]!=null && ds.Tables[0].Rows[0]["SUBJECT"].ToString()!="")
				{
					this.SUBJECT=ds.Tables[0].Rows[0]["SUBJECT"].ToString();
				}
				if(ds.Tables[0].Rows[0]["PAYMENT_TYPE"]!=null && ds.Tables[0].Rows[0]["PAYMENT_TYPE"].ToString()!="")
				{
					this.PAYMENT_TYPE=ds.Tables[0].Rows[0]["PAYMENT_TYPE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["TRADE_NO"]!=null && ds.Tables[0].Rows[0]["TRADE_NO"].ToString()!="")
				{
					this.TRADE_NO=ds.Tables[0].Rows[0]["TRADE_NO"].ToString();
				}
				if(ds.Tables[0].Rows[0]["TRADE_STATUS"]!=null && ds.Tables[0].Rows[0]["TRADE_STATUS"].ToString()!="")
				{
					this.TRADE_STATUS=ds.Tables[0].Rows[0]["TRADE_STATUS"].ToString();
				}
				if(ds.Tables[0].Rows[0]["GMT_CREATE"]!=null && ds.Tables[0].Rows[0]["GMT_CREATE"].ToString()!="")
				{
					this.GMT_CREATE=DateTime.Parse(ds.Tables[0].Rows[0]["GMT_CREATE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["GMT_PAYMENT"]!=null && ds.Tables[0].Rows[0]["GMT_PAYMENT"].ToString()!="")
				{
					this.GMT_PAYMENT=DateTime.Parse(ds.Tables[0].Rows[0]["GMT_PAYMENT"].ToString());
				}
				if(ds.Tables[0].Rows[0]["GMT_CLOSE"]!=null && ds.Tables[0].Rows[0]["GMT_CLOSE"].ToString()!="")
				{
					this.GMT_CLOSE=DateTime.Parse(ds.Tables[0].Rows[0]["GMT_CLOSE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["REFUND_STATUS"]!=null && ds.Tables[0].Rows[0]["REFUND_STATUS"].ToString()!="")
				{
					this.REFUND_STATUS=ds.Tables[0].Rows[0]["REFUND_STATUS"].ToString();
				}
				if(ds.Tables[0].Rows[0]["GMT_REFUND"]!=null && ds.Tables[0].Rows[0]["GMT_REFUND"].ToString()!="")
				{
					this.GMT_REFUND=DateTime.Parse(ds.Tables[0].Rows[0]["GMT_REFUND"].ToString());
				}
				if(ds.Tables[0].Rows[0]["SELLER_EMAIL"]!=null && ds.Tables[0].Rows[0]["SELLER_EMAIL"].ToString()!="")
				{
					this.SELLER_EMAIL=ds.Tables[0].Rows[0]["SELLER_EMAIL"].ToString();
				}
				if(ds.Tables[0].Rows[0]["BUYER_EMAIL"]!=null && ds.Tables[0].Rows[0]["BUYER_EMAIL"].ToString()!="")
				{
					this.BUYER_EMAIL=ds.Tables[0].Rows[0]["BUYER_EMAIL"].ToString();
				}
				if(ds.Tables[0].Rows[0]["SELLER_ID"]!=null && ds.Tables[0].Rows[0]["SELLER_ID"].ToString()!="")
				{
					this.SELLER_ID=ds.Tables[0].Rows[0]["SELLER_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["BUYER_ID"]!=null && ds.Tables[0].Rows[0]["BUYER_ID"].ToString()!="")
				{
					this.BUYER_ID=ds.Tables[0].Rows[0]["BUYER_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["PRICE"]!=null && ds.Tables[0].Rows[0]["PRICE"].ToString()!="")
				{
					this.PRICE=decimal.Parse(ds.Tables[0].Rows[0]["PRICE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["TOTAL_FEE"]!=null && ds.Tables[0].Rows[0]["TOTAL_FEE"].ToString()!="")
				{
					this.TOTAL_FEE=decimal.Parse(ds.Tables[0].Rows[0]["TOTAL_FEE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["QUANTITY"]!=null && ds.Tables[0].Rows[0]["QUANTITY"].ToString()!="")
				{
					this.QUANTITY=decimal.Parse(ds.Tables[0].Rows[0]["QUANTITY"].ToString());
				}
				if(ds.Tables[0].Rows[0]["BODY"]!=null && ds.Tables[0].Rows[0]["BODY"].ToString()!="")
				{
					this.BODY=ds.Tables[0].Rows[0]["BODY"].ToString();
				}
				if(ds.Tables[0].Rows[0]["DISCOUNT"]!=null && ds.Tables[0].Rows[0]["DISCOUNT"].ToString()!="")
				{
					this.DISCOUNT=decimal.Parse(ds.Tables[0].Rows[0]["DISCOUNT"].ToString());
				}
				if(ds.Tables[0].Rows[0]["IS_TOTAL_FEE_ADJUST"]!=null && ds.Tables[0].Rows[0]["IS_TOTAL_FEE_ADJUST"].ToString()!="")
				{
					this.IS_TOTAL_FEE_ADJUST=ds.Tables[0].Rows[0]["IS_TOTAL_FEE_ADJUST"].ToString();
				}
				if(ds.Tables[0].Rows[0]["USE_COUPON"]!=null && ds.Tables[0].Rows[0]["USE_COUPON"].ToString()!="")
				{
					this.USE_COUPON=ds.Tables[0].Rows[0]["USE_COUPON"].ToString();
				}
				if(ds.Tables[0].Rows[0]["EXTRA_COMMON_PARAM"]!=null && ds.Tables[0].Rows[0]["EXTRA_COMMON_PARAM"].ToString()!="")
				{
					this.EXTRA_COMMON_PARAM=ds.Tables[0].Rows[0]["EXTRA_COMMON_PARAM"].ToString();
				}
			}
		}

		/// <summary>
		/// 是否存在该记录
		/// </summary>
		public bool Exists(string NOTIFYASYNID)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select count(1) from T_ALIPAYNOTIFYASYN");
			strSql.Append(" where NOTIFYASYNID=:NOTIFYASYNID ");

			OracleParameter[] parameters = {
					new OracleParameter(":NOTIFYASYNID", OracleType.VarChar,50)};
			parameters[0].Value = NOTIFYASYNID;

			return DbHelperOra.Exists(strSql.ToString(),parameters);
		}


		/// <summary>
		/// 增加一条数据
		/// </summary>
		public void Add()
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into T_ALIPAYNOTIFYASYN (");
			strSql.Append("NOTIFYASYNID,NOTIFY_TIME,NOTIFY_TYPE,NOTIFY_ID,SIGN_TYPE,SIGN,OUT_TRADE_NO,SUBJECT,PAYMENT_TYPE,TRADE_NO,TRADE_STATUS,GMT_CREATE,GMT_PAYMENT,GMT_CLOSE,REFUND_STATUS,GMT_REFUND,SELLER_EMAIL,BUYER_EMAIL,SELLER_ID,BUYER_ID,PRICE,TOTAL_FEE,QUANTITY,BODY,DISCOUNT,IS_TOTAL_FEE_ADJUST,USE_COUPON,EXTRA_COMMON_PARAM)");
			strSql.Append(" values (");
			strSql.Append(":NOTIFYASYNID,:NOTIFY_TIME,:NOTIFY_TYPE,:NOTIFY_ID,:SIGN_TYPE,:SIGN,:OUT_TRADE_NO,:SUBJECT,:PAYMENT_TYPE,:TRADE_NO,:TRADE_STATUS,:GMT_CREATE,:GMT_PAYMENT,:GMT_CLOSE,:REFUND_STATUS,:GMT_REFUND,:SELLER_EMAIL,:BUYER_EMAIL,:SELLER_ID,:BUYER_ID,:PRICE,:TOTAL_FEE,:QUANTITY,:BODY,:DISCOUNT,:IS_TOTAL_FEE_ADJUST,:USE_COUPON,:EXTRA_COMMON_PARAM)");
			OracleParameter[] parameters = {
					new OracleParameter(":NOTIFYASYNID", OracleType.VarChar,10),
					new OracleParameter(":NOTIFY_TIME", OracleType.DateTime),
					new OracleParameter(":NOTIFY_TYPE", OracleType.VarChar,100),
					new OracleParameter(":NOTIFY_ID", OracleType.VarChar,100),
					new OracleParameter(":SIGN_TYPE", OracleType.VarChar,100),
					new OracleParameter(":SIGN", OracleType.VarChar,100),
					new OracleParameter(":OUT_TRADE_NO", OracleType.VarChar,64),
					new OracleParameter(":SUBJECT", OracleType.VarChar,256),
					new OracleParameter(":PAYMENT_TYPE", OracleType.VarChar,4),
					new OracleParameter(":TRADE_NO", OracleType.VarChar,16),
					new OracleParameter(":TRADE_STATUS", OracleType.VarChar,100),
					new OracleParameter(":GMT_CREATE", OracleType.DateTime),
					new OracleParameter(":GMT_PAYMENT", OracleType.DateTime),
					new OracleParameter(":GMT_CLOSE", OracleType.DateTime),
					new OracleParameter(":REFUND_STATUS", OracleType.VarChar,100),
					new OracleParameter(":GMT_REFUND", OracleType.DateTime),
					new OracleParameter(":SELLER_EMAIL", OracleType.VarChar,100),
					new OracleParameter(":BUYER_EMAIL", OracleType.VarChar,100),
					new OracleParameter(":SELLER_ID", OracleType.VarChar,30),
					new OracleParameter(":BUYER_ID", OracleType.VarChar,30),
					new OracleParameter(":PRICE", OracleType.Number,12),
					new OracleParameter(":TOTAL_FEE", OracleType.Number,12),
					new OracleParameter(":QUANTITY", OracleType.Number,12),
					new OracleParameter(":BODY", OracleType.VarChar,400),
					new OracleParameter(":DISCOUNT", OracleType.Number,12),
					new OracleParameter(":IS_TOTAL_FEE_ADJUST", OracleType.VarChar,1),
					new OracleParameter(":USE_COUPON", OracleType.VarChar,1),
					new OracleParameter(":EXTRA_COMMON_PARAM", OracleType.VarChar,100)};
			parameters[0].Value = NOTIFYASYNID;
			parameters[1].Value = NOTIFY_TIME;
			parameters[2].Value = NOTIFY_TYPE;
			parameters[3].Value = NOTIFY_ID;
			parameters[4].Value = SIGN_TYPE;
			parameters[5].Value = SIGN;
			parameters[6].Value = OUT_TRADE_NO;
			parameters[7].Value = SUBJECT;
			parameters[8].Value = PAYMENT_TYPE;
			parameters[9].Value = TRADE_NO;
			parameters[10].Value = TRADE_STATUS;
			parameters[11].Value = GMT_CREATE;
			parameters[12].Value = GMT_PAYMENT;
			parameters[13].Value = GMT_CLOSE;
			parameters[14].Value = REFUND_STATUS;
			parameters[15].Value = GMT_REFUND;
			parameters[16].Value = SELLER_EMAIL;
			parameters[17].Value = BUYER_EMAIL;
			parameters[18].Value = SELLER_ID;
			parameters[19].Value = BUYER_ID;
			parameters[20].Value = PRICE;
			parameters[21].Value = TOTAL_FEE;
			parameters[22].Value = QUANTITY;
			parameters[23].Value = BODY;
			parameters[24].Value = DISCOUNT;
			parameters[25].Value = IS_TOTAL_FEE_ADJUST;
			parameters[26].Value = USE_COUPON;
			parameters[27].Value = EXTRA_COMMON_PARAM;

			DbHelperOra.ExecuteSql(strSql.ToString(),parameters);
		}
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update()
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update T_ALIPAYNOTIFYASYN set ");
			strSql.Append("NOTIFY_TIME=:NOTIFY_TIME,");
			strSql.Append("NOTIFY_TYPE=:NOTIFY_TYPE,");
			strSql.Append("NOTIFY_ID=:NOTIFY_ID,");
			strSql.Append("SIGN_TYPE=:SIGN_TYPE,");
			strSql.Append("SIGN=:SIGN,");
			strSql.Append("OUT_TRADE_NO=:OUT_TRADE_NO,");
			strSql.Append("SUBJECT=:SUBJECT,");
			strSql.Append("PAYMENT_TYPE=:PAYMENT_TYPE,");
			strSql.Append("TRADE_NO=:TRADE_NO,");
			strSql.Append("TRADE_STATUS=:TRADE_STATUS,");
			strSql.Append("GMT_CREATE=:GMT_CREATE,");
			strSql.Append("GMT_PAYMENT=:GMT_PAYMENT,");
			strSql.Append("GMT_CLOSE=:GMT_CLOSE,");
			strSql.Append("REFUND_STATUS=:REFUND_STATUS,");
			strSql.Append("GMT_REFUND=:GMT_REFUND,");
			strSql.Append("SELLER_EMAIL=:SELLER_EMAIL,");
			strSql.Append("BUYER_EMAIL=:BUYER_EMAIL,");
			strSql.Append("SELLER_ID=:SELLER_ID,");
			strSql.Append("BUYER_ID=:BUYER_ID,");
			strSql.Append("PRICE=:PRICE,");
			strSql.Append("TOTAL_FEE=:TOTAL_FEE,");
			strSql.Append("QUANTITY=:QUANTITY,");
			strSql.Append("BODY=:BODY,");
			strSql.Append("DISCOUNT=:DISCOUNT,");
			strSql.Append("IS_TOTAL_FEE_ADJUST=:IS_TOTAL_FEE_ADJUST,");
			strSql.Append("USE_COUPON=:USE_COUPON,");
			strSql.Append("EXTRA_COMMON_PARAM=:EXTRA_COMMON_PARAM");
			strSql.Append(" where NOTIFYASYNID=:NOTIFYASYNID ");
			OracleParameter[] parameters = {
					new OracleParameter(":NOTIFY_TIME", OracleType.DateTime),
					new OracleParameter(":NOTIFY_TYPE", OracleType.VarChar,100),
					new OracleParameter(":NOTIFY_ID", OracleType.VarChar,100),
					new OracleParameter(":SIGN_TYPE", OracleType.VarChar,100),
					new OracleParameter(":SIGN", OracleType.VarChar,100),
					new OracleParameter(":OUT_TRADE_NO", OracleType.VarChar,64),
					new OracleParameter(":SUBJECT", OracleType.VarChar,256),
					new OracleParameter(":PAYMENT_TYPE", OracleType.VarChar,4),
					new OracleParameter(":TRADE_NO", OracleType.VarChar,16),
					new OracleParameter(":TRADE_STATUS", OracleType.VarChar,100),
					new OracleParameter(":GMT_CREATE", OracleType.DateTime),
					new OracleParameter(":GMT_PAYMENT", OracleType.DateTime),
					new OracleParameter(":GMT_CLOSE", OracleType.DateTime),
					new OracleParameter(":REFUND_STATUS", OracleType.VarChar,100),
					new OracleParameter(":GMT_REFUND", OracleType.DateTime),
					new OracleParameter(":SELLER_EMAIL", OracleType.VarChar,100),
					new OracleParameter(":BUYER_EMAIL", OracleType.VarChar,100),
					new OracleParameter(":SELLER_ID", OracleType.VarChar,30),
					new OracleParameter(":BUYER_ID", OracleType.VarChar,30),
					new OracleParameter(":PRICE", OracleType.Number,12),
					new OracleParameter(":TOTAL_FEE", OracleType.Number,12),
					new OracleParameter(":QUANTITY", OracleType.Number,12),
					new OracleParameter(":BODY", OracleType.VarChar,400),
					new OracleParameter(":DISCOUNT", OracleType.Number,12),
					new OracleParameter(":IS_TOTAL_FEE_ADJUST", OracleType.VarChar,1),
					new OracleParameter(":USE_COUPON", OracleType.VarChar,1),
					new OracleParameter(":EXTRA_COMMON_PARAM", OracleType.VarChar,100),
					new OracleParameter(":NOTIFYASYNID", OracleType.VarChar,10)};
			parameters[0].Value = NOTIFY_TIME;
			parameters[1].Value = NOTIFY_TYPE;
			parameters[2].Value = NOTIFY_ID;
			parameters[3].Value = SIGN_TYPE;
			parameters[4].Value = SIGN;
			parameters[5].Value = OUT_TRADE_NO;
			parameters[6].Value = SUBJECT;
			parameters[7].Value = PAYMENT_TYPE;
			parameters[8].Value = TRADE_NO;
			parameters[9].Value = TRADE_STATUS;
			parameters[10].Value = GMT_CREATE;
			parameters[11].Value = GMT_PAYMENT;
			parameters[12].Value = GMT_CLOSE;
			parameters[13].Value = REFUND_STATUS;
			parameters[14].Value = GMT_REFUND;
			parameters[15].Value = SELLER_EMAIL;
			parameters[16].Value = BUYER_EMAIL;
			parameters[17].Value = SELLER_ID;
			parameters[18].Value = BUYER_ID;
			parameters[19].Value = PRICE;
			parameters[20].Value = TOTAL_FEE;
			parameters[21].Value = QUANTITY;
			parameters[22].Value = BODY;
			parameters[23].Value = DISCOUNT;
			parameters[24].Value = IS_TOTAL_FEE_ADJUST;
			parameters[25].Value = USE_COUPON;
			parameters[26].Value = EXTRA_COMMON_PARAM;
			parameters[27].Value = NOTIFYASYNID;

			int rows=DbHelperOra.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}

		/// <summary>
		/// 删除一条数据
		/// </summary>
		public bool Delete(string NOTIFYASYNID)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("delete from T_ALIPAYNOTIFYASYN ");
			strSql.Append(" where NOTIFYASYNID=:NOTIFYASYNID ");
			OracleParameter[] parameters = {
					new OracleParameter(":NOTIFYASYNID", OracleType.VarChar,50)};
			parameters[0].Value = NOTIFYASYNID;

			int rows=DbHelperOra.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}


		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public void GetModel(string NOTIFYASYNID)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select NOTIFYASYNID,NOTIFY_TIME,NOTIFY_TYPE,NOTIFY_ID,SIGN_TYPE,SIGN,OUT_TRADE_NO,SUBJECT,PAYMENT_TYPE,TRADE_NO,TRADE_STATUS,GMT_CREATE,GMT_PAYMENT,GMT_CLOSE,REFUND_STATUS,GMT_REFUND,SELLER_EMAIL,BUYER_EMAIL,SELLER_ID,BUYER_ID,PRICE,TOTAL_FEE,QUANTITY,BODY,DISCOUNT,IS_TOTAL_FEE_ADJUST,USE_COUPON,EXTRA_COMMON_PARAM ");
			strSql.Append(" FROM T_ALIPAYNOTIFYASYN ");
			strSql.Append(" where NOTIFYASYNID=:NOTIFYASYNID ");
			OracleParameter[] parameters = {
					new OracleParameter(":NOTIFYASYNID", OracleType.VarChar,50)};
			parameters[0].Value = NOTIFYASYNID;

			DataSet ds=DbHelperOra.Query(strSql.ToString(),parameters);
			if(ds.Tables[0].Rows.Count>0)
			{
				if(ds.Tables[0].Rows[0]["NOTIFYASYNID"]!=null && ds.Tables[0].Rows[0]["NOTIFYASYNID"].ToString()!="")
				{
					this.NOTIFYASYNID=ds.Tables[0].Rows[0]["NOTIFYASYNID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["NOTIFY_TIME"]!=null && ds.Tables[0].Rows[0]["NOTIFY_TIME"].ToString()!="")
				{
					this.NOTIFY_TIME=DateTime.Parse(ds.Tables[0].Rows[0]["NOTIFY_TIME"].ToString());
				}
				if(ds.Tables[0].Rows[0]["NOTIFY_TYPE"]!=null && ds.Tables[0].Rows[0]["NOTIFY_TYPE"].ToString()!="")
				{
					this.NOTIFY_TYPE=ds.Tables[0].Rows[0]["NOTIFY_TYPE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["NOTIFY_ID"]!=null && ds.Tables[0].Rows[0]["NOTIFY_ID"].ToString()!="")
				{
					this.NOTIFY_ID=ds.Tables[0].Rows[0]["NOTIFY_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["SIGN_TYPE"]!=null && ds.Tables[0].Rows[0]["SIGN_TYPE"].ToString()!="")
				{
					this.SIGN_TYPE=ds.Tables[0].Rows[0]["SIGN_TYPE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["SIGN"]!=null && ds.Tables[0].Rows[0]["SIGN"].ToString()!="")
				{
					this.SIGN=ds.Tables[0].Rows[0]["SIGN"].ToString();
				}
				if(ds.Tables[0].Rows[0]["OUT_TRADE_NO"]!=null && ds.Tables[0].Rows[0]["OUT_TRADE_NO"].ToString()!="")
				{
					this.OUT_TRADE_NO=ds.Tables[0].Rows[0]["OUT_TRADE_NO"].ToString();
				}
				if(ds.Tables[0].Rows[0]["SUBJECT"]!=null && ds.Tables[0].Rows[0]["SUBJECT"].ToString()!="")
				{
					this.SUBJECT=ds.Tables[0].Rows[0]["SUBJECT"].ToString();
				}
				if(ds.Tables[0].Rows[0]["PAYMENT_TYPE"]!=null && ds.Tables[0].Rows[0]["PAYMENT_TYPE"].ToString()!="")
				{
					this.PAYMENT_TYPE=ds.Tables[0].Rows[0]["PAYMENT_TYPE"].ToString();
				}
				if(ds.Tables[0].Rows[0]["TRADE_NO"]!=null && ds.Tables[0].Rows[0]["TRADE_NO"].ToString()!="")
				{
					this.TRADE_NO=ds.Tables[0].Rows[0]["TRADE_NO"].ToString();
				}
				if(ds.Tables[0].Rows[0]["TRADE_STATUS"]!=null && ds.Tables[0].Rows[0]["TRADE_STATUS"].ToString()!="")
				{
					this.TRADE_STATUS=ds.Tables[0].Rows[0]["TRADE_STATUS"].ToString();
				}
				if(ds.Tables[0].Rows[0]["GMT_CREATE"]!=null && ds.Tables[0].Rows[0]["GMT_CREATE"].ToString()!="")
				{
					this.GMT_CREATE=DateTime.Parse(ds.Tables[0].Rows[0]["GMT_CREATE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["GMT_PAYMENT"]!=null && ds.Tables[0].Rows[0]["GMT_PAYMENT"].ToString()!="")
				{
					this.GMT_PAYMENT=DateTime.Parse(ds.Tables[0].Rows[0]["GMT_PAYMENT"].ToString());
				}
				if(ds.Tables[0].Rows[0]["GMT_CLOSE"]!=null && ds.Tables[0].Rows[0]["GMT_CLOSE"].ToString()!="")
				{
					this.GMT_CLOSE=DateTime.Parse(ds.Tables[0].Rows[0]["GMT_CLOSE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["REFUND_STATUS"]!=null && ds.Tables[0].Rows[0]["REFUND_STATUS"].ToString()!="")
				{
					this.REFUND_STATUS=ds.Tables[0].Rows[0]["REFUND_STATUS"].ToString();
				}
				if(ds.Tables[0].Rows[0]["GMT_REFUND"]!=null && ds.Tables[0].Rows[0]["GMT_REFUND"].ToString()!="")
				{
					this.GMT_REFUND=DateTime.Parse(ds.Tables[0].Rows[0]["GMT_REFUND"].ToString());
				}
				if(ds.Tables[0].Rows[0]["SELLER_EMAIL"]!=null && ds.Tables[0].Rows[0]["SELLER_EMAIL"].ToString()!="")
				{
					this.SELLER_EMAIL=ds.Tables[0].Rows[0]["SELLER_EMAIL"].ToString();
				}
				if(ds.Tables[0].Rows[0]["BUYER_EMAIL"]!=null && ds.Tables[0].Rows[0]["BUYER_EMAIL"].ToString()!="")
				{
					this.BUYER_EMAIL=ds.Tables[0].Rows[0]["BUYER_EMAIL"].ToString();
				}
				if(ds.Tables[0].Rows[0]["SELLER_ID"]!=null && ds.Tables[0].Rows[0]["SELLER_ID"].ToString()!="")
				{
					this.SELLER_ID=ds.Tables[0].Rows[0]["SELLER_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["BUYER_ID"]!=null && ds.Tables[0].Rows[0]["BUYER_ID"].ToString()!="")
				{
					this.BUYER_ID=ds.Tables[0].Rows[0]["BUYER_ID"].ToString();
				}
				if(ds.Tables[0].Rows[0]["PRICE"]!=null && ds.Tables[0].Rows[0]["PRICE"].ToString()!="")
				{
					this.PRICE=decimal.Parse(ds.Tables[0].Rows[0]["PRICE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["TOTAL_FEE"]!=null && ds.Tables[0].Rows[0]["TOTAL_FEE"].ToString()!="")
				{
					this.TOTAL_FEE=decimal.Parse(ds.Tables[0].Rows[0]["TOTAL_FEE"].ToString());
				}
				if(ds.Tables[0].Rows[0]["QUANTITY"]!=null && ds.Tables[0].Rows[0]["QUANTITY"].ToString()!="")
				{
					this.QUANTITY=decimal.Parse(ds.Tables[0].Rows[0]["QUANTITY"].ToString());
				}
				if(ds.Tables[0].Rows[0]["BODY"]!=null && ds.Tables[0].Rows[0]["BODY"].ToString()!="")
				{
					this.BODY=ds.Tables[0].Rows[0]["BODY"].ToString();
				}
				if(ds.Tables[0].Rows[0]["DISCOUNT"]!=null && ds.Tables[0].Rows[0]["DISCOUNT"].ToString()!="")
				{
					this.DISCOUNT=decimal.Parse(ds.Tables[0].Rows[0]["DISCOUNT"].ToString());
				}
				if(ds.Tables[0].Rows[0]["IS_TOTAL_FEE_ADJUST"]!=null && ds.Tables[0].Rows[0]["IS_TOTAL_FEE_ADJUST"].ToString()!="")
				{
					this.IS_TOTAL_FEE_ADJUST=ds.Tables[0].Rows[0]["IS_TOTAL_FEE_ADJUST"].ToString();
				}
				if(ds.Tables[0].Rows[0]["USE_COUPON"]!=null && ds.Tables[0].Rows[0]["USE_COUPON"].ToString()!="")
				{
					this.USE_COUPON=ds.Tables[0].Rows[0]["USE_COUPON"].ToString();
				}
				if(ds.Tables[0].Rows[0]["EXTRA_COMMON_PARAM"]!=null && ds.Tables[0].Rows[0]["EXTRA_COMMON_PARAM"].ToString()!="")
				{
					this.EXTRA_COMMON_PARAM=ds.Tables[0].Rows[0]["EXTRA_COMMON_PARAM"].ToString();
				}
			}
		}

		/// <summary>
		/// 获得数据列表
		/// </summary>
		public DataSet GetList(string strWhere)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select * ");
			strSql.Append(" FROM T_ALIPAYNOTIFYASYN ");
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			return DbHelperOra.Query(strSql.ToString());
		}

		#endregion  Method
	}
}

